import request from '@/utils/request'

// 创建数据集
export function createDataSet(data) {
  return request({
    url: '/idata/data-set/create',
    method: 'post',
    data: data
  })
}

// 更新数据集
export function updateDataSet(data) {
  return request({
    url: '/idata/data-set/update',
    method: 'put',
    data: data
  })
}

// 删除数据集
export function deleteDataSet(id) {
  return request({
    url: '/idata/data-set/delete?id=' + id,
    method: 'delete'
  })
}

// 获得数据集
export function getDataSet(id) {
  return request({
    url: '/idata/data-set/get?id=' + id,
    method: 'get'
  })
}

// 获得数据集分页
export function getDataSetPage(query) {
  return request({
    url: '/idata/data-set/page',
    method: 'get',
    params: query
  })
}

// 导出数据集 Excel
export function exportDataSetExcel(query) {
  return request({
    url: '/idata/data-set/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
